<script type="text/javascript" src="http://www.12301.cc/js/Calendar.js"></script>
<link rel="stylesheet" href="http://www.12301.cc/css/getbill.css"/>
<link rel="stylesheet" href="http://www.12301.cc/css/page.css"/>
<div class="clay">
	<h3 class="mc_title">
		<span class="mctit_1"><span class="mctit_2"><?=$h3Title?></span></span>
	</h3>
	<ul class="navi">
		<li><a href="" class="settle current">已出账单</a></li>
		<li><a href="settle_config.html?about=<?=$about?>">结算周期配置</a></li>
		<?php if($showOfflineFlag===true):?>
        <li><a href="bill_offline.html?about=<?=$about?>">现场/在线支付账单</a></li>
        <?php endif;?>
	</ul>
	<div class="settleContain">
		<div class="contain">
			<form action="" class="search">
				<div class="box">
					<span>
						<input type="submit" class="sub" value="查 询"/>
						<label>出账日期:</label>
						<input type="text" name="btime" class="time" value="<?=$_REQUEST['btime']?>" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)"/>
						<label>至</label>
						<input type="text" name="etime" class="time" value="<?=$_REQUEST['etime']?>" onmouseup="SelectDate(this,'yyyy-MM-dd',0,0)"/>
					</span>
					<span class="status">
						<label>结算状态:</label>
						<input type="checkbox" name="status[]" <?if(in_array(0,$status)) echo "checked";?> value="0"/> 未结算
						<input type="checkbox" name="status[]" <?if(in_array(1,$status)) echo "checked";?> value="1"/> 结算中
						<input type="checkbox" name="status[]" <?if(in_array(2,$status)) echo "checked";?> value="2"/> 已结算
					</span>
				</div>
			</form>
		</div>
		<?if(count($r)>0):?>
		<div class="content">
			<table>
				<tr>
					<?if($about=="get"){?>
					<th class="tl">分销商</th>
					<?}else{?>
					<th class="tl">供应商</th>
					<?}?>
					<th>出账日期</th>
					<th>账单期间</th>
					<th>账单明细</th>
					<th>订单数</th>
					<th>票数</th>
					<th>总金额(元)</th>
					<th>结算状态</th>
					<th>操作</th>
				</tr>
				<?foreach($r as $row):?>
				<tr>
					<?if($about=="get"):?>
					<td class="tl"><?=$dnames[$row['fid']]?></td>
					<?else:?>
					<td class="tl"><?=$dnames[$row['aid']]?></td>
					<?endif;?>
					<td><?=date("Ymd",strtotime($row['etime']))?></td>
					<td>
						<span title="<?=$row['btime']?>"><?=substr($row['btime'],0,10)?></span>
						至
						<span title="<?=$row['etime']?>"><?=substr($row['etime'],0,10)?></span>
					</td>
					<td>
						<a class="fdetail" target="_blank" href="bill_count.html?id=<?=$row['id']?>">汇总</a>
						|
						<a class="fdetail" target="_blank" href="bill_detail.html?id=<?=$row['id']?>">明细</a>
					</td>
					<td><?=$row['orders']?></td>
					<td><?=$row['tnums']?></td>
					<td><?=$row['money']/100?></td>
					<td><?=$statusT[$row['status']]?></td>
					<td>
						<a  class="billalter" href="call/handle.php?from=bill_alter&act=complete&id=<?=$row['id']?>">完成</a>
					</td>
				</tr>
				<?endforeach;?>
			</table>
		</div>
		<?endif;?>
	</div>
	<?if($count!=0):page($count,$currentPage,$pageSize);endif;?>
</div>
<script type="text/javascript" src="http://www.12301.cc/js/fsettle.js"></script>